package
{
	import com.yzy.debug.Stats;
	import com.yzy.loader.LoaderList;
	import com.yzy.loader.event.LoadInfoEvent;
	import com.yzy.models.SetLibs;
	import com.yzy.tool.ByteResolve;
	
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.utils.ByteArray;
	
	import game.Game;
	
	import starling.core.Starling;
	
	import test.Test;
	
	[SWF(width="800", height="550", frameRate="60", backgroundColor="#ffffff")]
	public class Bejeweled extends Sprite
	{
		public function Bejeweled()
		{
			stage.scaleMode=StageScaleMode.NO_SCALE;
			stage.align=StageAlign.TOP_LEFT;
			//
			LoaderList.instant.addEventListener(LoadInfoEvent.COMPLETE_EVENT,loadComplete);
			LoaderList.instant.GetLoaderList("assist/Material");
		}
		
		private function loadComplete(event:Event):void
		{
			this.addChild(new Stats());
			Test.instant;
			//
			var bytes:ByteArray=SetLibs.getLibsData("symbol");
			ByteResolve.byteForSwf(bytes,resolveSwfComplete);
		}
		
		private function resolveSwfComplete():void{
			init();
		}
		
		private var _starling:Starling;
		private function init():void{
			_starling = new Starling(Game, stage);
			_starling.start();
		}
		
	}
}